const getDate = (price, discount, date, dateUnit) => {
    let monthMoney = 0.0;
    if (dateUnit === 0) {
        // 年
        monthMoney = (price * discount) / (date * 12);
        return monthMoney.toFixed(2) + "/月";
    } else if (dateUnit === 1) {
        // 天
        monthMoney = (price * discount) / (date * 24);
        return monthMoney.toFixed(2) + "/时";
    } else {
        // 月
        monthMoney = (price * discount) / (date * 30);
        return monthMoney.toFixed(2) + "/天";
    }
};



export default {
    getDate
}


